package com.example.singletonpattern;

/**
 * @author liw
 * &#064;date  2022-10-23
 */
public class Singleton5 {

    private static Singleton5 instance;

    private Singleton5() {
    }

    public static Singleton5 getInstance() {
        if (instance == null) {
            synchronized (Singleton5.class
            ) {
                instance = new Singleton5();
            }
        }
        return instance;
    }
}
